import React from "react";
import styles from "./style.module.scss";

interface PropsType {
    assignment: string,
    btnTheme?: string,
    isAccomplish?: boolean,
    HCurrency?: string,
    style?: React.CSSProperties,
    onClick?:()=>void
}

const Index: React.FC<PropsType> = ({
    assignment,
    btnTheme = "azure",
    isAccomplish = false,
    HCurrency = "",
    style,
    onClick
}) => {
    // 签到标签
    return <div>
        
            <div className={styles.assignmentItem} >
                <div className={styles.assignmentContent}>
                    <div className={styles.assignment} style={style}>{assignment}</div>
                    <div className={HCurrency ? styles.HCurrency : styles.falseHCurrency}>
                        <span className={styles.HCurrencyColor}>{HCurrency}</span>
                        H币</div>
                </div>
          {
                btnTheme === "azure" ?   
                <button onClick={()=> onClick && onClick()} disabled={isAccomplish} className={isAccomplish ? styles.accomplish : styles.goAccomplish}>{isAccomplish ? "已完成" : "去完成"}</button> : 
                <button className={isAccomplish ? styles.accomplish : styles.draw}>{isAccomplish ? "已完成" : "领H币"}</button>
          }
            </div>
    </div>;
};

export default Index;
